var e = require;
var t = module;
var n = exports;
Object.defineProperty(n, "__esModule", {
    value: !0
});
var o = cc._decorator,
i = o.ccclass,
a = o.property,
r = function(e) {
    __extends(t, e);
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        t.panel = null;
        t.closeBtnNode = null;
        t.callBack = null;
        return t
    }
    n = t;
    t.prototype.onLoad = function() {
        n.Instance = this
    };
    t.prototype.start = function() {};
    t.prototype.openPanel = function(e) {
        var t = this;
        if (SDK.Mgr.Inst.curChannel != SDK.Define.Channel.tt || SDK.Mgr.Inst.customData && "on" == SDK.Mgr.Inst.customData.openVideoCancel) {
            SDK.Mgr.Inst.event("ShowVideoHintView");
            this.panel.active = !0;
            this.callBack = e;
            this.closeBtnNode.active = !1;
            this.scheduleOnce(function() {
                t.closeBtnNode.active = !0
            },
            SDK.Mgr.Inst.closeDelayTime)
        } else SDK.ToastMgr.Inst.showToast("视频没有看完哦")
    };
    t.prototype.panelBtnClick = function() {
        SDK.Mgr.Inst.curChannel == SDK.Define.Channel.tt && SDK.Mgr.Inst.isAdOpen && this.confirmBtnClick()
    };
    t.prototype.confirmBtnClick = function() {
        var e = this,
        t = "VideoHint_Ad";
        SDK.Mgr.Inst.event(t + "Click");
        SDK.Mgr.Inst.showVideo(function(n) {
            if (n == SDK.Define.AdsCode.finish) {
                SDK.Mgr.Inst.event(t + "Success");
                e.panel.active = !1;
                if (e.callBack) {
                    e.callBack(SDK.Define.AdsCode.finish);
                    e.callBack = null
                }
            } else n == SDK.Define.AdsCode.cancel ? SDK.Mgr.Inst.event(t + "Cancel") : SDK.Mgr.Inst.event(t + "NoAd")
        })
    };
    t.prototype.closePanel = function() {
        this.panel.active = !1;
        SDK.ToastMgr.Inst.showToast("视频没有看完哦");
        this.callBack && (this.callBack = null)
    };
    var n;
    t.Instance = null;
    __decorate([a(cc.Node)], t.prototype, "panel", void 0);
    __decorate([a(cc.Node)], t.prototype, "closeBtnNode", void 0);
    return n = __decorate([i], t)
} (cc.Component);
n.default = r